<template>
  <transition name="slideup">
    <div class="coupon-wrap" v-if="isShowCoupon">
      <div class="clearfix p15 bgf">
        <span class="fl">不使用优惠券</span>
        <div class="fr">
          <label class="label1" for="no">
            <input type="checkbox" name="all" id="no">
            <span></span></label>
        </div>
      </div>
      <ul class="coupon-list">
        <li @click="selectCoupon()">
          <div class="coupon-head">
            <span class="fl">新人-白酒券</span> <span class="fr">可用</span>
          </div>
          <div class="coupon-body">
            <div class="money"><b>¥</b>29</div>
            <div class="coupon-desc">
              <p class="fz14 fc-7"> 单笔订单满109元可用</p>
              <p class="fz12 fc-7 mt5">本券适用于所有白酒</p>
            </div>
          </div>
          <div class="line"></div>
          <div class="coupon-foot clearfix fc-7">
            <span class="fl fz10 fc-9">有效期至：2018/05/22</span> <span class="fr fz12">特价商品、秒杀活动除外</span>
          </div>
        </li><li>
          <div class="coupon-head">
            <span class="fl">新人-白酒券</span> <span class="fr">可用</span>
          </div>
          <div class="coupon-body">
            <div class="money"><b>¥</b>29</div>
            <div class="coupon-desc">
              <p class="fz14 fc-7"> 单笔订单满109元可用</p>
              <p class="fz12 fc-7 mt5">本券适用于所有白酒</p>
            </div>
          </div>
          <div class="line"></div>
          <div class="coupon-foot clearfix fc-7">
            <span class="fl fz10 fc-9">有效期至：2018/05/22</span> <span class="fr fz12">特价商品、秒杀活动除外</span>
          </div>
        </li>
      </ul>
    </div>
  </transition>
</template>

<script>
  import getuser from '@/util/getuser'
  import config from '@/config/config'
  import {formatDate} from '@/util/util.js';
  export default {
    components: {},
    props: ['isShowCoupon'],
    data(){
      return {
        couponList: [],
      };
    },

    methods: {
      hide(){
        this.$parent.closeCouponWrap()
      },
      selectCoupon(){
        this.hide()
      },
    },
    filters: {
      formatDate(time) {
        if (time) {
          var date = new Date(time * 1000);
          return formatDate(date);
        }
      },
    },
  }
</script>


<style scoped>
  .slideup-enter-active, .slideup-leave-active{
    transition:all .3s
  }
  .slideup-enter, .slideup-leave-to{
    transform:translateX(100%);
    opacity:0;
  }
  .coupon-wrap{
    width:100%;
    height:100%;
    position:absolute;
    left:0;
    bottom:0;
    z-index:100;
    background:#f5f5f5;
    transition:all .4s;
    text-align:left;
  }
  .label1 input{
    opacity:0;
    position:absolute;
    left:0; top:0;
  }
  .label1 input + span{
    display:inline-block;
    vertical-align:middle;
    width:20px;
    height:20px;
    margin-right:.5rem;
    margin-left:13px;
    background:url(images/icon-check.svg) 0 0 no-repeat;
    -webkit-background-size:100%; background-size:100%;
  }
  .label1 input:checked + span{
    background:url(images/icon-checked.svg) 0 0 no-repeat;
    -webkit-background-size:100%; background-size:100%;
  }
  .bgf{ background:#fff; }
  .p15{
    padding:.75rem;
  }
  .coupon-list{
    margin:.75rem;
    overflow:hidden;
  }
  .coupon-list li{
    background:#fff;
    border:1px solid #F7E0E0;
    border-radius:5px;
    margin-bottom:.75rem;
  }
  .coupon-head{
    overflow:hidden;
    font-size: .6rem;
    color: #F74C4E;
    padding:.75rem .75rem 0;
  }
  .coupon-body{
    padding:.5rem .75rem;
    overflow:hidden;
  }
  .money{
    font-size: 2rem;
    color: #E93B3D;
    float:left;
  }
  .money b{
    font-size:.5rem;
    margin-right:.2rem;
  }
  .coupon-desc{
    float:left;
    padding-top:.3rem;
    padding-left:1.2rem;
    text-overflow:ellipsis;
    white-space:nowrap;
    overflow:hidden;
  }
  .fz10{ font-size:.5rem; }
  .fz12{ font-size:.6rem; }
  .fz14{ font-size:.7rem; }
  .fc-7{color: #777;}
  .fc-9{color: #999;}
  .bdt{
    border-top:1px dashed #FFBCBC;
  }
  .coupon-foot{
    padding:.5rem .75rem;
  }
  .line{
    width:100%;
    height:0;
    border-top:1px dashed #FFBCBC;
    position:relative;
  }
  .line:before{
    content:'';
    width:8px;
    height:8px;
    border-radius:100%;
    background-color:#f5f5f5;
    border:1px solid #FFBCBC;
    position:absolute;
    top:-8px;
    left:-6px;
    z-index:2;
  }
  .line:after{
    content:'';
    width:8px;
    height:8px;
    border-radius:100%;
    background-color:#f5f5f5;
    border:1px solid #FFBCBC;
    position:absolute;
    top:-8px;
    right:-6px;
    z-index:2;
  }
  .mt5{ margin-top:.25rem;}
</style>
